<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>确认书发放</title>
	<link rel="stylesheet" href="css/reset.css">
	<link rel="stylesheet" href="css/product.css">
	<link rel="stylesheet" href="css/select-big.css">
	<link rel="stylesheet" href = "css/fuzzy-query.css">
	<style>
		.content-btn {
		    margin: 0 16px;
		}
		.product-child-content{
			width: 970px;
			margin: 0 auto;
		}
		.product-child-content .content-btn {
		    margin: 0;
		}
		.content-table-two tbody tr td input{
			width: 80%;
			height: 30px;
			line-height: 30px;
			background: #F9FBFF;
			border: 1px solid #ecf2f7;
			border-radius: 15px;
			text-align: center;
		}
		.icon-delImg{
			display: inline-block;
		    background: url(images/close-1.png)no-repeat;
		    width: 25px;
		    height: 25px;
		    cursor: pointer;
		}
		.icon-delImg:hover{
			background: url(images/close-1.png)no-repeat 0 -27px;
		}
	</style>
</head>
<body>
<div class="main-content">
	<div class="main-bg1">
		<div class="content-btn bot-line">
			<a class="icon-back" href="subscriptionConfirmation.html"></a><span class="title-info-a">认购书确认发放</span>
		</div>
		<div class="content-list">
			<table class="content-table-newservice" cellspacing="0" cellpadding="0">
				<tbody>
					<tr>
						<td><span class="info-red"><font color="red">*</font>收件人部门：</span></td>
						<td><div class = "fuzzy-query" dataUrl = "/org/selectAllDeptTree" dataname = "departmentname" datavalue = addressee lablename = "parentName" valuename = "parentId"></div></td>
					</tr>
					<tr>
						<td><span class="info-red"><font color="red">*</font>快递公司：</span></td>
						<td><select class="multiselect" name="company" id="company">
							    <option value="1">顺丰快递</option>
								<option value="2">圆通快递</option>
								<option value="3">申通快递</option>
								<option value="4">韵达快递</option>
								<option value="5">汇通快递</option>
								<option value="6">邮政EMS</option>
								<option value="7">自取</option>
						</select></td>
					</tr>
					<tr>
						<td><span class="info-red"><font color="red">*</font>快递单号：</span></td>
						<td><input type="text" id="confirtracknumber"name ="confirtracknumber"></td>
					</tr>
					<tr>
						<td>描述：</td>
						<td><textarea name="remark" id="remark" cols="30" rows="3"></textarea></td>
					</tr>
				</tbody>
			</table>
		</div>
		<div class="product-child-content">
			<div class="content-info">
				<div class="content-btn bot-line">
					<span class="title-info">纸质合同信息</span>
				</div>
				<table  id="table" class="tableOrder content-table-two matop" cellspacing="0" cellpadding="0">
				    <tbody style = "display:none;">
				            <th title = "id" style = "display:none;" name = "id" type = "string"></th>
							<th title = "项目编码" name = "projectcode" type = "string"></th>
							<th title = "项目名称" name = "projectname" type = "string"></th>
							<th title = "客户编号" name = "appoint.custcode" type = "string"></th>
							<th title = "客户名称" name = "appoint.custname" type = "string"></th>
							<th title = "到账金额" name = "transfercash" type = "Integer"></th>
							<th title = "合同编号" name = "contractcode" type = "string"></th>
							<th title = "理顾姓名" name = "isname" type = "string" ></th>
							<th title = "理顾编号" name = "iscode" type = "string"></th>
							<th title = "操作" name = "op" type = "string"></th>
										<!-- <th title = "印刷厂" name = "printer" type = "dict" dictType = "printer" ></th> -->
					</tbody>
				<!-- 	<thead>
						<tr>
							<td style="width:100px;" >项目编号</td>
							<td style="width:250px;">项目名称</td>
							<td style="width:100px;">客户编号</td>
							<td style="width:100px;">客户名称</td>
							<td style="width:120px;">到账金额</td>
							<td style="width:120px;">合同编号</td>
							<td style="width:150px;">理顾姓名</td>
							<td style="width:70px;">操作</td>
						</tr>
					</thead>
					<tbody id="selectInfo">
					
					</tbody> -->
				</table>
				<button class="save-btn matop" type="botton" id="save">保存</button>
			</div>
		</div>
	</div>
</div>
	<script src="js/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
	<script src="js/select.jquery.js"></script>
	<script type="text/javascript" src = "js/util.js"></script>
	<script type="text/javascript" src = "js/table.js"></script>
	<script type="text/javascript" src = "js/fuzzy-query.js"></script>
    <script type="text/javascript">
		function tableCallBack(my){
			my.children('tbody').eq(1).children('tr').each(function(){
				var $td = $(this).children('td:last');
				$td.append('<i class="icon-delImg" onclick="del(this)"></i>');
			})
		}
        function getHeight(){
            var myiframeH=$(".main-content").height();
            var _parent=$(window.parent.document);
            _parent.find('body').css('height',(myiframeH+150)+'px');
            _parent.find('.main-position').css('height',(myiframeH+100)+'px');
        };

        function del(my){
        	my = $(my);
        	my.parent().parent().remove();
        }
        $('.main-content').resize(function(){
            getHeight();
        });
        $(document).ready(function (){
        	$('#addressee').multiselect({multiple:false,selectedHtmlValue:'石家庄第一营业部',setWidth: 338+'px'});
    		$('#company').multiselect({multiple:false,selectedHtmlValue:'顺丰快递',setWidth: 338+'px'});
        	var datas = parent.getData();
        	$('#table').ECDATable(datas);
        	$('#save').click(function(){
        		var ids = [];
        		$('#table').children('tbody').eq(1).children('tr').each(function(){
        			ids.push($(this).children('td').eq(0).text());
        		})
        	var data = {};
        		data.ids = ids.join(",");	
        		data.confirtrackstatus ='5'; 
        		data.addressee = $('.fuzzy-query').find('select').val();
        		data.company = $('#company').val();
        		data.confirtracknumber = $('#confirtracknumber').val();
        		data.reason = $('#remark').val();
        		data.remark = $('#remark').val();
        		 AjaxDate('contractDetail/sendContractDetail',data);
        	})
        })
        function callbackDateInfo(date){
        	layer.msg("'发放成功！",{
			    offset:'20%'
			});	
        	 window.location.href="subscriptionConfirmation.html";
        }
	</script>
</body>
</html>